﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModulesPage.aspx.cs" Inherits="RGPWEB.admin.Modubles.ModulesPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>功能模块管理</title>
    <link href="../../inc/Style/childindex.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
        function change_child_win() {
            var childleftdiv = document.getElementById("childleftdiv");
            var ContentPanel = document.getElementById("ContentPanel");
            ContentPanel.style.height = window.frames["ContentPanel"].document.body.scrollHeight;
            childleftdiv.style.height = window.frames["ContentPanel"].document.body.scrollHeight;
        }

        window.onresize = function() {
        change_child_win();
            

        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div id="childleftdiv" style="float: left; height: auto !important; height: 450px;
        min-height: 450px; border-right: 1px #9f9d9f solid;">
        <table width="100" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td class="titlePadding">
                    &nbsp;模块列表
                </td>
            </tr>
            <tr>
                <td style=" padding:5px 10px 5px 10px;">
                    <asp:TreeView ID="Treeview1" runat="server" ImageSet="XPFileExplorer" AutoGenerateDataBindings="False"
                        ExpandDepth="0" NodeIndent="15">
                        <SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False" HorizontalPadding="0px"
                            VerticalPadding="0px"></SelectedNodeStyle>
                        <Nodes>
                            <asp:TreeNode Expanded="True" NavigateUrl="ModulesInfoPage.aspx?id=0&type=2" Target="ContentPanel"
                                Text="模块管理" Value="0,0"></asp:TreeNode>
                        </Nodes>
                        <NodeStyle VerticalPadding="2px" Font-Names="Tahoma" Font-Size="8pt" HorizontalPadding="2px"
                            ForeColor="Black" NodeSpacing="0px"></NodeStyle>
                        <ParentNodeStyle Font-Bold="False" />
                        <HoverNodeStyle Font-Underline="True" ForeColor="#6666AA"></HoverNodeStyle>
                    </asp:TreeView>
                </td>
            </tr>
        </table>
    </div>
    <div id="childrightdiv" style="float: left;">
        <iframe id="ContentPanel" name="ContentPanel" width="100%" frameborder="0" scrolling="auto"
            src="ModulesInfoPage.aspx" onload="this.height=ContentPanel.document.body.scrollHeight;window.parent.changewin();">
        </iframe>
    </div>
    </form>
</body>
</html>

<script type="text/javascript">
    //2. 只打开一个节点,关闭其他兄弟节点(Just one expanded node, all other will collaps)
    function TreeView_ToggleNode(data, index, node, lineType, children) {
        var img = node.childNodes[0];
        var newExpandState;
        try {
            //***折叠兄弟节点(Collapse Brothers)-----
            CollapseBrothers(data, children);
            //---------------------------------------

            if (children.style.display == "none") {
                children.style.display = "block";
                newExpandState = "e";
                if ((typeof (img) != "undefined") && (img != null)) {
                    if (lineType == "l") {
                        img.src = data.images[15];
                    }
                    else if (lineType == "t") {
                        img.src = data.images[12];
                    }
                    else if (lineType == "-") {
                        img.src = data.images[18];
                    }
                    else {
                        img.src = data.images[5];
                    }
                    img.alt = data.collapseToolTip.replace(/\{0\}/, TreeView_GetNodeText(node));
                }
            }
            else {
                children.style.display = "none";
                newExpandState = "c";
                if ((typeof (img) != "undefined") && (img != null)) {
                    if (lineType == "l") {
                        img.src = data.images[14];
                    }
                    else if (lineType == "t") {
                        img.src = data.images[11];
                    }
                    else if (lineType == "-") {
                        img.src = data.images[17];
                    }
                    else {
                        img.src = data.images[4];
                    }
                    img.alt = data.expandToolTip.replace(/\{0\}/, TreeView_GetNodeText(node));
                }
            }
            change_child_win();
        }
        catch (e) { }
        data.expandState.value = data.expandState.value.substring(0, index) + newExpandState + data.expandState.value.slice(index + 1);
    }

    //折叠兄弟节点(Collapse Brothers)
    function CollapseBrothers(data, childContainer) {
        var parent = childContainer.parentNode;
        for (i = 0; i < parent.childNodes.length; i++) {
            if (parent.childNodes[i].tagName.toLowerCase() == "div") {
                if (parent.childNodes[i].id != childContainer.id) {
                    parent.childNodes[i].style.display = "none"
                }
            }
            else if (parent.childNodes[i].tagName.toLowerCase() == "table") {
                var treeLinks = parent.childNodes[i].getElementsByTagName("a");
                var j = 0;
                if (treeLinks[j].firstChild.tagName) {
                    if (treeLinks[j].firstChild.tagName.toLowerCase() == "img") {
                        var img = treeLinks[j].firstChild;
                        img.src = data.images[4];
                    }
                }
            }
        }
    }
</script>

